<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 绑定函数，点击触发 -->
        <button v-on:click="search()">查询</button><br/>

        <!-- 简写 -->
        <button @click="search()">查询</button><br/>
        <!-- 触发之后，修改了内部的值，使得这里也发生变化。多了一个超链接 -->
        <p>
            <a v-bind:href="result.site" target="_blank">{{result.title}}</a>
        </p>
    </div>
    <script src="vue.min.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                searchMap: {
                    keyWord: "尚硅谷"
                },
                // 查询结果
                result: {}
            },
            methods: {  // 保存一些方法
                search() {
                    this.result = {
                    "title":"尚硅谷",
                    "site":"http://www.atguigu.com"
                }
                    console.log("search")
                }
            }
        })
    </script>
</body>

</html>